const app = require('./router')
const http = require('http');
const ejs = require('ejs')

http.createServer(app).listen(3000);


app.get('/', function (req, res) {
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.end('sy');
})

app.get('/login', function (req, res) {
    ejs.renderFile('./login.html', (err, data) => {
        res.writeHead(200, { 'Content-Type': 'text/html;charset="utf-8"' });
        res.end(data);
    })
})

app.post('/login', function (req, res) {
    res.writeHead(200, { 'Content-Type': 'text/html;charset="utf-8"' });
    res.end(data);
})


app.get('/qq', function (req, res) {
    res.writeHead(200, { 'Content-Type': 'text/html;charset="utf-8"' });
    res.end('l am qq');
})
app.get('/ww', function (req, res) {
    res.writeHead(200, { 'Content-Type': 'text/html;charset="utf-8"' });
    res.end('l am ww');
})

console.log('Server running at http://127.0.0.1:3000/');
